from pyutils import get_GET_ret, mytest_api, mytest_f_speed
import requests


host = 'http://127.0.0.1:8000'
local_headers = {
    'Content-Type': 'application/json',
    'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyOCwidXNlcm5hbWUiOiIxODUxMDc3OTEwMiIsImV4cCI6MTYyMjE4MjkyNSwiZW1haWwiOm51bGwsIm9yaWdfaWF0IjoxNjE2OTk4OTI1fQ.fC33BRfy9nPqVMmVchJQ9QKNOkD6zQIenT_6lYPvk2M',
}


class TestClass:
    def test_get_user_info(self):
        url = host + '/api/ui/get_user_info/'
        mytest_api(url=url, headers=local_headers)

    def test_get_competition_info(self):
        url = '/api/ui/get_competition_info/'
        url = host + url
        # mytest_api(url=url, headers=local_headers)
        ret = get_GET_ret(url, local_headers)
        assert ret.get('status') == 200
        print(ret.get('result'))


if __name__ == '__main__':
    tc = TestClass()
    tc.test_get_user_info()




